#pragma once

typedef struct s_map_block s_map_block;
#include "c_tile.h"

enum terrain_type
{
	TERRAIN_ANY,
	TERRAIN_NONE,
	TERRAIN_OCEAN,
	TERRAIN_RIVER,
	TERRAIN_STREAM,
	TERRAIN_SWAMP,
	TERRAIN_FOREST_TEMP,
	TERRAIN_FOREST_TROP,
	TERRAIN_GRASS_TEMP,
	TERRAIN_GRASS_TROP,
	TERRAIN_BADLANDS,
	TERRAIN_ROCK,
	TERRAIN_BEACH,
	TERRAIN_TAIGA,
	TERRAIN_GLACIER,
	TERRAIN_TUNDRA,
	TERRAIN_MOUNTAIN,
	TERRAIN_MOUNTAIN_TALL,
	//manmade follows
	TERRAIN_VILLAGE,
	TERRAIN_FARM_PLANTED,
	TERRAIN_FARM_FALLOW,
	TERRAIN_FARM_PASTURE,
	TERRAIN_FORT_KEEP,
	TERRAIN_FORT_GATE,
	TERRAIN_FORT_WALL,
	TERRAIN_FORT_COURT,
	TERRAIN_ROAD,
	TERRAIN_BRIDGE,
	TERRAIN_TUNNEL,
	TERRAIN_ELF_CENTER,
	TERRAIN_ELF_EDGE,
	TERRAIN_GOBLIN_CENTER,
	TERRAIN_GOBLIN_EDGE,
	TERRAIN_DORF_CENTER,
	TERRAIN_DORF_EDGE,
	TERRAIN_COUNT
};

#define LEVEL_TEMPERATURE 0
#define LEVEL_RAINFALL 1
#define LEVEL_DRAINAGE 2
#define LEVEL_SAVAGE 3
#define LEVEL_VOLCANISM 4
#define LEVEL_VEGETATION 5
#define LEVEL_EVIL 6
#define LEVEL_SALINITY 7

#define NUM_LEVELS 8

struct s_map_block
{
	int height;
	int water_height;
	unsigned char levels[8];
	c_tile * sprite;
	ALLEGRO_COLOR color;
	terrain_type terrain;
	unsigned char terrain_borders[TERRAIN_COUNT];
	double random;
	ALLEGRO_COLOR light;
};